<?php

    class DatoOrden extends BaseModel{
        static $table_name = 'datosorden';
        static $primary_key = 'iddatosorden';
        static $belongs_to = array(
            array(
                '_orden', 
                'class_name' => 'Orden',
                'foreign_key'=> 'orden'
            ),
            array(
            '_tipoPrestacion',
             'class_name' => 'TipoPrestacion',
             'foreign_key' => 'tipoPrestacion'
            ),
            array(
            '_prestacion',
             'class_name' => 'PrestacionMedica',
             'foreign_key' => 'prestacion'
            ),
            array(
            '_prestador',
             'class_name' => 'Profesional',
             'foreign_key' => 'prestador'
            )
        );
        
        function calcular_coseguro(){
            $valor_plus = $this->_orden->_plus->coeficiente;
            $base = GeneralConfig::find_by_nombre('coseguro_base');
        }
        
    }

?>
